package com.yunhe.authority.domain.authority;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ProjectTree
 * @Description TODO
 * @Author HeTao
 * @Date 2021/2/24 17:46
 * @Version 1.0
 **/
@ApiModel(value = "ProjectTree", description = "项目树对象")
public class ProjectTree {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("code")
    private String code;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("类型")
    private  String type;

    @ApiModelProperty("父id")
    private Long parentId;

    @ApiModelProperty("层级")
    private Integer level;

    @ApiModelProperty("子节点")
    private List<ProjectTree> children;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<ProjectTree> getChildren() {
        return children;
    }

    public void setChildren(List<ProjectTree> children) {
        this.children = children;
    }

    public Integer getLevel() {
        return level;
    }

    public void addChild(ProjectTree deviceTree) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(deviceTree);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }
}
